/*
 * @Author: 铃兰 wanglili@publink.cn
 * @Date: 2024-04-30 16:02:45
 * @LastEditors: 铃兰 wanglili@publink.cn
 * @LastEditTime: 2024-05-13 15:08:25
 * @FilePath: /shb-pc-fe/src/api/SparePart.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import http from '@src/util/HttpUtil';
let urlHead = '/api/part';


// partV2/repertory/repertoryApply.vue
export function rejectBatch(params = {}) {
  return http.post(`${urlHead}/outside/dd/part/approveList/rejectBatch`, params, false)
}

export function revokeBatch(params = {}) {
  return http.post(`${urlHead}/outside/dd/part/approveList/revokeBatch`, params, false)
}

export function approveBatch(params = {}) {
  return http.post(`${urlHead}/outside/dd/part/approveList/approveBatch`, params)
}

export function getRelationListByApproveNo(params = {}) {
  return http.get(`${urlHead}/outside/dd/part/approveList/getRelationListByApproveNo`, params)
}

export function getProgress(params={}){
  return http.get(`${urlHead}/outside/dd/part/approveList/getProgress`,params);
}


// 查询多个清单详情
export function getRelationsByApproveNos(params={}){
  return http.get(`${urlHead}/outside/dd/part/approveList/getRelationsByApproveNos`,params);
}

// 批量办理
export function approveBatchByApproveNos(params={}){
  return http.post(`${urlHead}/outside/dd/part/approveList/approveBatchByApproveNos`,params);
}

// 修改退回时目标库
export function updateBackTarget(params){
  return http.post(`${urlHead}/outside/dd/part/approveList/updateBackTarget`,params);
}
// 获得备件字段列表
export function getPartField(){
  return http.get('/partV2/category/partField');
}

// 获取备件列表字段
export function getSparepartFields(){
  return http.get(`${urlHead}/outside/sparepart/getSparepartFields`);
}

// 获取备品类列表
export function partV2ListData(params = {}){
  return http.post('/partV2/category/listData', params);
}

// 获取备件占用列表
export function getSparepartOccupancy(params = {}){
  return http.post('/api/point/outside/ywd/sparepartOccupancy', params);
}
// 导出备件占用列表
export function exportSparepartOccupancy(params = {}){
  return http.post('/api/point/outside/ywd/exportSparepartOccupancy', params);
}
// 获取仓库类型
export function getRepertoryListForTeam(params = {}){
  return http.get('/partV2/repertory/listForTeam', params);
}

// 备件占用时间查询
export function getStatisticsTime(params = {}){
  return http.get('/api/point/outside/ywd/getStatisticsTime', params);
}

/** 根据备件查询个人库数量 */
export function getListByUserAndSparePartIds(params = {}){
  return http.post('/partV2/repertory/person/getListByUserAndSparepartIds', params);
}